<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //substring
        var str = "helloworld"
        var newstr = str.substring(1,4)//[start,end)
        console.log(str)
        console.log(newstr)

        console.log("===========================================================")
        //substr
        var newStr = str.substr(1,3)
        console.log(newStr)

        console.log("===========================================================")
        //replace
        var str1 = "how are aRe are you"
        var newStr1 = str1.replace("are","WTF")
        var newSrt2 = str1.replace(/are/g,"WTFF")
        console.log(str1)
        console.log(newStr1)
        console.log(newSrt2)

        console.log("===========================================================")
        var str2 = "how  are you"
        var arr = str2.split(" ",2)
        var arr1 = str2.split("")
        console.log(str2)
        console.log(arr)//返回值object
        console.log(arr1) 

    </script>
</head>
<body>
    
</body>
</html>